import request from '@/router/axios';
import config from '@/config/website'

//列表
export const changePriceList = (current, size, equipment) => {
    return request({
        url: '/api/blade-sale/productmodifyprice/page',
        method: 'get',
        params: {
            current,
            size,
            ...equipment
        }
    })
}


//新建
export const changePriceAdd = (data) => {
    return request({
        url: '/api/blade-sale/productmodifyprice/save',
        method: 'post',
        data
    })
}
//修改
export const changePriceUpdate = (data) => {
    return request({
        url: '/api/blade-sale/productmodifyprice/update',
        method: 'post',
        data
    })
}
//查看
export const changePriceView = (id) => {
    return request({
        url: '/api/blade-sale/productmodifyprice/detail',
        method: 'get',
        params: {
            id
        }
    })
}

//删除
export const changePriceDel = (ids) => {
    return request({
        url: '/api/blade-sale/productmodifyprice/remove',
        method: 'post',
        params: {
            ids
        }
    })
}
//产品协议价格列表
export const getProductPriceList = (customerId) => {
    return request({
        url: '/api/blade-sale/productmodifyprice/productPriceList',
        method: 'get',
        params: {
            customerId
        }
    })
}
//产品列表
export const productList = (id) => {
    return request({
        url: '/api/blade-sale/productmodifyprice/productPriceSubList',
        method: 'get',
        params: {
            id
        }
    })
}
export const priceSave = (data) => {
    return request({
        url: '/api/blade-sale/productpricesub/update',
        method: 'post',
        data
    })
}
//提交
export const changePriceSubmit = (id) => {
    return request({
        url: '/api/blade-sale/productmodifyprice/start-process',
        method: 'post',
        params: {
            id,
        }
    })
}
//产品要求子表
export const changepriceBotList = (productModifyPriceId, equipment) => {
    return request({
        url: '/api/blade-sale/productmodifypricesub/list',
        method: 'get',
        params: {
            productModifyPriceId,
            ...equipment
        }
    })
}
//子表修改
export const changepriceUpdate = (data) => {
    return request({
        url: '/api/blade-sale/productmodifypricesub/update',
        method: 'post',
        data
    })
}
//子表删除
export const changepriceDel = (ids) => {
    return request({
        url: '/api/blade-sale/productmodifypricesub/remove',
        method: 'post',
        params: {
            ids
        }
    })
}